package br.com.ianalise.modelo;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import br.com.ianalise.negocio.excecoes.IAnaliseException;

public class ConexaoBD {

	public static Connection getConnection() throws IAnaliseException {

		try {
			Class.forName("org.sqlite.JDBC");
			return DriverManager
					.getConnection("jdbc:sqlite:bd/iAnalise.sqlite");
		}

		catch (ClassNotFoundException e) {
			e.printStackTrace();
			// throw new SQLException(e.getMessage());
			throw new IAnaliseException(e.toString());
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new IAnaliseException(e.toString());
		}
	}
}